package com.util;



import java.util.List;


import javax.persistence.Entity;
import javax.persistence.OneToMany;
import org.hibernate.Session;
import org.hibernate.Transaction;

import com.collegeInfo.model.College;

@Entity
public class BaseDAO {
	
	protected Session session;
	
	protected Transaction tx;
	
	@OneToMany
	protected List<College> allColleges = this.getCollegeDictionary();
	
	protected List<College> getCollegeDictionary(){
		session=HibernateSessionFactory.getSession();
		String hql="FROM College";
		List<College> list=session.createQuery(hql).list();
		return list;
	}
}
